using MediatR;
using System.ComponentModel.DataAnnotations;

namespace B.S.NewMedical.Api.Write.Application.Command.ContentManagement.Department
{
    /// <summary>
    /// 新增科室命令（支持一级科室和二级科室）
    /// </summary>
    public class AddDepartmentCommand : IRequest<int>
    {
        /// <summary>
        /// 科室名称
        /// </summary>
        [Required(ErrorMessage = "科室名称不能为空")]
        [StringLength(100, ErrorMessage = "科室名称长度不能超过100个字符")]
        public string DepartmentName { get; set; } = string.Empty;

        /// <summary>
        /// 科室类型（门诊/住院）
        /// </summary>
        [Required(ErrorMessage = "科室类型不能为空")]
        [StringLength(50, ErrorMessage = "科室类型长度不能超过50个字符")]
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 父级科室ID（0表示一级科室，大于0表示二级科室）
        /// </summary>
        [Range(0, int.MaxValue, ErrorMessage = "父级科室ID不能为负数")]
        public int ParetId { get; set; } = 0;

        /// <summary>
        /// 科室位置
        /// </summary>
        [StringLength(200, ErrorMessage = "科室位置长度不能超过200个字符")]
        public string? DepartmentAddr { get; set; }

        /// <summary>
        /// 是否支持急诊服务
        /// </summary>
        public bool IsEmergencyService { get; set; } = false;

        /// <summary>
        /// 科室上线状态
        /// </summary>
        public bool IsOnline { get; set; } = true;

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500, ErrorMessage = "备注长度不能超过500个字符")]
        public string? remark { get; set; }

        /// <summary>
        /// 操作人
        /// </summary>
        public string? CreatePeople { get; set; }
    }
}